<input type="text" name="fav" id="fav" value="足球">
<script>
	function Vue(){
      this.fav;
      this.el = document.getElementById('fav');
      this.observe(this);

  }


   Vue.prototype.observe = function(vue){
             var value;
             var self = this;//
   	         Object.defineProperty(vue,"fav",{
			get : function() {
				return value;//巨坑啊 不返回就undifine了
			},
			set : function(newValue) {// 递归调用 直接赋值会产生递归
				value = newValue;
				console.log("set方法调用");
				  self.render();//此处的this 是object
			}
		});
   }



function getCurrVal(){
  fav = document.getElementById("fav").value;
   console.log(fav);
   this.fav = fav;
 }

 Vue.prototype.render = function() {
	this.el.value = this.fav;
}

  var vue = new Vue();
  setInterval(function(){getCurrVal()},300);


</script>